package edu.jd.movieplatform.search.movie;


import edu.jd.movieplatform.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/search/movie")
public class MovieAPI {

    @Resource
    private MovieService movieService;


    @RequestMapping("/movie-list")
    public Result movieList(MovieDto dto){

        List<Movie> movieList = movieService.getMovieList(dto);
        return Result.success(movieList);

    }

    @GetMapping("/query")
    public Result getMovieByKeyword(String keyword){
        List<Movie> movieList = movieService.getMovieByKeyword(keyword);
        return Result.success(movieList);
    }


}
